package com.yaoxiaowen.project2.base;


import android.app.Fragment;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yaoxiaowen.project2.util.log.debug.LogInterface;
import com.yaoxiaowen.project2.util.log.debug.LogTool;
import com.yaoxiaowen.project2.util.log.debug.ShowInterface;

import butterknife.ButterKnife;

/**
 * A simple {@link Fragment} subclass.
 */
public abstract class BaseFragment extends Fragment implements View.OnClickListener{

    protected static LogInterface mLog = LogTool.getLogType();
    protected static ShowInterface mShow;



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(getLayoutId(),container, false);
        ButterKnife.bind(this,view);
        mShow = LogTool.getShowType(getActivity());
        return view;
    }


    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        initData();
        initView();
        initListener();
    }

    abstract protected int getLayoutId();
    abstract protected void initData();
    abstract protected void initView();
    abstract protected void initListener();

    @Override
    public void onClick(View v) {

    }
}
